<Window x:Class="MathematicallySafe.HeadCounter.Views.HeadCounterView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:c="clr-namespace:MathematicallySafe.HeadCounter.Commands"
        xmlns:Views="clr-namespace:MathematicallySafe.HeadCounter.Views"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Width="1152"  Height="720"  MinHeight="600"  MinWidth="800"
        AllowsTransparency="True"  Background="Transparent"  BorderBrush="#F5F5F5"  BorderThickness="1"  Icon="/Resources/HeadCounter.ico"   ResizeMode="CanResizeWithGrip"
        Template="{StaticResource ModernWindowStyle}"  WindowStyle="None"
        MouseLeftButtonDown="Window_MouseLeftButtonDown">
    
        <Window.Resources>
            <c:CommandReference x:Key="ExitCommandReference" Command="{Binding ExitCommand}"/>
            <c:CommandReference x:Key="PasteRaidCommandReference" Command="{Binding ElementName=RaidImportView, Path=ViewModel.PasteRaidCommand}"/>
        </Window.Resources>
    
        <Window.InputBindings>
            <KeyBinding Key="X" Command="{StaticResource ExitCommandReference}" Modifiers="Control"/>
            <KeyBinding Key="V" Command="{StaticResource PasteRaidCommandReference}" Modifiers="Control"/>
        </Window.InputBindings>
    
        <Grid Background="{StaticResource DefaultBackground}">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            
            <Grid Grid.Row="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                
                <StackPanel Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Right">
                    <Views:CommandContainer Margin="0,4"/>
                </StackPanel>
                
                <StackPanel Grid.Column="1" Margin="20,1">
                    <Image Width="48" Height="48" Source="/Resources/HeadCounter.jpg"/>
                </StackPanel>
                
                <StackPanel Grid.Column="2" VerticalAlignment="Top" Orientation="Horizontal" Margin="2,8,4,2">
                    <Button Name="Minimise" Click="Minimise_Click" Style="{StaticResource GlyphButton}">
                        <Viewbox Stretch="Fill">
                        <Path Data="{StaticResource Minimise}" Style="{StaticResource GlyphButtonStyle}"/>
                        </Viewbox>
                        </Button>
                        <Button Name="Maximise" Click="Maximise_Click" Style="{StaticResource GlyphButton}">
                        <Viewbox Stretch="Fill">
                        <Path  Data="{StaticResource Maximise}" Style="{StaticResource GlyphButtonStyle}"/>
                        </Viewbox>
                        </Button>
                        <Button Command="{StaticResource ExitCommandReference}" Style="{StaticResource GlyphButton}">
                        <Viewbox Stretch="Fill">
                        <Path Data="{StaticResource CloseX}" Style="{StaticResource GlyphButtonStyle}"/>
                        </Viewbox>
                    </Button>
                </StackPanel>
            </Grid>

            <TabControl Grid.Row="2" Style="{StaticResource MainTabControl}">
                
                <TabItem Header="{Binding GuildName}" Style="{StaticResource MainTabControlItem}">
                    <TabControl Style="{StaticResource SubTabControl}">
                        <TabItem Header="players" Style="{StaticResource SubTabControlItem}" >
                            <Views:RaidersView x:Name="PlayersView" />
                        </TabItem>
                        <TabItem Header="raids" Style="{StaticResource SubTabControlItem}">
                            <Views:RaidsView x:Name="RaidsView" />
                        </TabItem>
                        <TabItem Header="roster" Style="{StaticResource SubTabControlItem}">
                            <Views:RosterView x:Name="RosterView" />
                        </TabItem>
                    </TabControl>
                </TabItem>
                
                <TabItem Header="DATA" Style="{StaticResource MainTabControlItem}">
                    <TabControl Style="{StaticResource SubTabControl}">
                        <TabItem Header="import" Style="{StaticResource SubTabControlItem}">
                            <Views:RaidImportView x:Name="RaidImportView" />
                        </TabItem>
                        <TabItem Header="export" Style="{StaticResource SubTabControlItem}">
                            <Grid Margin="100,25,0,0" TextElement.FontSize="14" TextElement.FontWeight="Bold">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>
                                
                                <TextBlock Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" >Create a small HTML only website.</TextBlock>
                                <Button Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" Margin="8" Command="{Binding ExportHtmlCommand}">Export Html</Button>
                                
                                <TextBlock Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" Margin="0,0,32,0" >Update the HeadCounter addon with the latest data.</TextBlock>
                                <Button Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" Margin="8" Command="{Binding ExportLuaCommand}">Export Lua</Button>
                                
                                <TextBlock Grid.Row="2" Grid.Column="0" VerticalAlignment="Center">Do all the above</TextBlock>
                                <Button Grid.Row="2" Grid.Column="1" VerticalAlignment="Center" Margin="8" Command="{Binding ExportAllCommand}">Export All</Button>
                            </Grid>
                        </TabItem>
                    <TabItem Header="sync" Style="{StaticResource SubTabControlItem}">
                        <Views:SyncView x:Name="SyncView" />
                    </TabItem>
                    <TabItem Header="loot" Style="{StaticResource SubTabControlItem}">
                        <Views:LootView x:Name="LootView" />
                    </TabItem>
                    </TabControl>
                </TabItem>

            <TabItem Header="OPTIONS" Style="{StaticResource MainTabControlItem}">
                <TabControl Style="{StaticResource SubTabControl}">
                    <TabItem Header="general" Style="{StaticResource SubTabControlItem}">
                        <Views:GeneralOptionsView x:Name="OptionsGeneralView" />
                    </TabItem>
                    <TabItem Header="export" Style="{StaticResource SubTabControlItem}">
                        <Views:ExportOptionsView x:Name="OptionsExportView" />
                    </TabItem>
                    <TabItem Header="advanced" Style="{StaticResource SubTabControlItem}">
                    </TabItem>
                </TabControl>
            </TabItem>

        </TabControl>

        <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,20,20">
            <TextBlock Style="{StaticResource StatusMessageStyle}" Visibility="{Binding Path=StatusMessageActive, Converter={StaticResource HiddenIfFalse}}" Text="{Binding StatusMessage}" />
        </StackPanel>

    </Grid>
</Window>